<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Hoodoo::Logger::FlattenerMixin</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        <h1>
            <span class="type">Module</span>
            Hoodoo::Logger::FlattenerMixin
        </h1>
        <ul class="files">
            <li><a href="../../../files/lib/hoodoo/logger/flattener_mixin_rb.html">lib/hoodoo/logger/flattener_mixin.rb</a></li>
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
    <div class="description">
      
<p>This mixin is used by custom logger subclasses and defines a single method,
<a href="FlattenerMixin.html#method-i-flatten">#flatten</a>, which takes
structured log data and turns it into a single line of output including ISO
8601 time and date in local server time zone (since that makes log analysis
easier for humans working in non-UTC time zone regions).</p>

<p>Using this is of course entirely optional, but if you do use it, you will
be ensuring consistent non-structured log output across any non-structured
writers.</p>

    </div>








    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
        <dt>F</dt>
        <dd>
          <ul>
              <li>
                <a href="#method-i-flatten">flatten</a>
              </li>
          </ul>
        </dd>
    </dl>










    <!-- Methods -->
      <div class="sectiontitle">Instance Public methods</div>
        <div class="method">
          <div class="title method-title" id="method-i-flatten">
              <b>flatten</b>( log_level, component, code, data )
            <a href="../../../classes/Hoodoo/Logger/FlattenerMixin.html#method-i-flatten" name="method-i-flatten" class="permalink">Link</a>
          </div>

            <div class="description">
              <p>Take the parameters from <a
href="WriterMixin.html#method-i-report">Hoodoo::Logger::WriterMixin#report</a>
and return a single line string representing the “flattened” log data.</p>
            </div>



            <div class="sourcecode">
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-flatten_source')" id="l_method-i-flatten_source">show</a>
              </p>
              <div id="method-i-flatten_source" class="dyn-source">
                <pre><span class="ruby-comment"># File lib/hoodoo/logger/flattener_mixin.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">flatten</span>( <span class="ruby-identifier">log_level</span>, <span class="ruby-identifier">component</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">data</span> )
  <span class="ruby-node">&quot;#{ log_level.to_s.upcase } [#{ Time.now.iso8601( 6 ) }] #{ component } - #{ code }: #{ data.inspect }&quot;</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
          </div>
</div>

    </div>
  </body>
</html>
